<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>G-code WebGL Previewer</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            width: 100vw;
            background-color: #f0f0f0;
        }

        #container {
            text-align: center;
            display: flex;
            justify-content: space-evenly;
            align-items: center;
            width: 100%;
        }


        #textarea {
            width: 100%;
            height: 200px;
            margin-bottom: 20px;
        }

        #canvas {
            border: 1px solid #ccc;
        }
    </style>
</head>

<body>
    <div id="container">
        <canvas id="canvas" width="400" height="400"></canvas>
        <div>
            <textarea id="textarea" placeholder="Paste your G-code here"></textarea>
            <br>
            <button onclick="parseAndRender()">Render G-code</button>
        </div>
    </div>
    <script>
        textarea.value = `M5\n$H\nG90\nM3S0\nG1X50Y50F6000S0\nF1200S300\nX46.429Y46.429\nX42.857Y42.857\nX39.286Y39.286\nX35.714Y35.714\nX32.143Y32.143\nX28.571Y28.571\nX25Y25\nX21.429Y21.429\nX17.857Y17.857\nX14.286Y14.286\nX10.714Y10.714\nX7.143Y7.143\nX3.571Y3.571\nX0.001Y0.001\nM5\nM2\nF6000`

    </script>
    <script src="Grid.js"></script>
    <script src="tmpParseGcode.js"></script>
    <script src="GcodePreview.js"></script>
    <!-- <script src="webgl.js"></script> -->
    <script src="script.js"></script>
    <script>
        function parseAndRender() {
            const grid = new Grid();
            const gcodePreview = new GcodePreview();

        }
    </script>
</body>

</html>